package com.qls.ali.api;


import com.alibaba.fastjson.JSONObject;
import com.qls.core.dto.BatchPushRatesBody;
import com.qls.core.dto.PushHotelBody;
import com.qls.core.dto.PushRpBody;
import com.qls.core.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author yunchao
 */
@FeignClient("ali-service")
public interface AliRemoteService {

    /**
     * 酒店推送
     *
     * @param pushHotelBody PushHotelBody
     * @return R
     */
    @PostMapping("ali/hotel/push")
    R pushHotel(@RequestBody PushHotelBody pushHotelBody);

    /**
     * 价态推送
     *
     * @param batchPushRatesBody BatchPushRatesBody
     * @return R
     */
    @PostMapping("ali/rates/push")
    R pushRates(@RequestBody BatchPushRatesBody batchPushRatesBody);

    /**
     * rp推送
     *
     * @param pushRpBody PushRpBody
     * @return R
     */
    @PostMapping("ali/rp/push")
    R pushRp(@RequestBody PushRpBody pushRpBody);

    /**
     * 下单渠道回调通知
     *
     * @param data JSONObject
     * @return R
     */
    @RequestMapping(value = "ali/order/callback", method = RequestMethod.POST)
    R callback(@RequestBody JSONObject data);

    /**
     * 前端人工下单
     *
     * @param map Map<String, Object>
     * @return R
     */
    @RequestMapping(value = "ali/order/buy", method = RequestMethod.GET)
    R buy(@RequestParam Map<String, Object> map);


}
